package com.atguigu.ssoserver.refactoring.pojo;

import lombok.AllArgsConstructor;

@AllArgsConstructor
public class Rental {
    //被租赁的电影

    private Movie _movie;
    //租期
    private int _daysRented;

    public Movie getMovie(){
        return _movie;
    }

    public int getDaysRented(){
        return _daysRented;
    }

    double getCharge(){
//        if (_movie instanceof RegularMovie){
//            return (RegularMovie)_movie.getCharge(_daysRented);
//        } else if (_movie instanceof ChildrensMovie){
//            return (ChildrensMovie)_movie.getCharge(_daysRented);
//        }else (_movie instanceof NewReleaseMovie){
//            return (NewReleaseMovie)_movie.getCharge(_daysRented);
//        }
        return _movie.getCharge(_daysRented);
    }

    int getFrequentRenterPoints(){
        return _movie.getFrequentRenterPoints(_daysRented);
    }
}
